package com.scapegoat.pay.user.service.api.impl;

import java.util.HashMap;
import java.util.Map;

import com.scapegoat.pay.user.service.dao.RpUserPayInfoDao;
import com.scapegoat.pay.user.service.entity.RpUserPayInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.scapegoat.pay.common.core.page.PageBean;
import com.scapegoat.pay.common.core.page.PageParam;
import com.scapegoat.pay.user.service.api.RpUserPayInfoService;


/**
 * 用户第三方支付信息service实现类
 *
 * @author walkman
 * @date 2017年10月17日 20:54:34
 */
@Service("rpUserPayInfoService")
public class RpUserPayInfoServiceImpl implements RpUserPayInfoService {

    @Autowired
    private RpUserPayInfoDao rpUserPayInfoDao;

    @Override
    public void saveData(RpUserPayInfo rpUserPayInfo) {
        rpUserPayInfoDao.insert(rpUserPayInfo);
    }

    @Override
    public void updateData(RpUserPayInfo rpUserPayInfo) {
        rpUserPayInfoDao.update(rpUserPayInfo);
    }

    @Override
    public RpUserPayInfo getDataById(String id) {
        return rpUserPayInfoDao.getById(id);
    }

    @Override
    public PageBean listPage(PageParam pageParam, RpUserPayInfo rpUserPayInfo) {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        return rpUserPayInfoDao.listPage(pageParam, paramMap);
    }

    /**
     * 通过商户编号获取商户支付配置信息
     *
     * @param userNo
     * @return
     */
    @Override
    public RpUserPayInfo getByUserNo(String userNo, String payWayCode) {
        return rpUserPayInfoDao.getByUserNo(userNo, payWayCode);
    }
}